import root
from fastapi import APIRouter
from typing import Union

from app.conf import conf

router = APIRouter(prefix="/apis/demo", tags=["demo"])


@router.get("/hello-world")
def read_root():
    return {"Hello": "World", "app_name": conf.app_name, "root": root.get_root_path()}


@router.get("/items/{item_id}")
def read_item(item_id: int, q: Union[str, None] = None):
    return {"item_id": item_id, "q": q}
